﻿app.controller("ngAddPostController", function ($scope, $http, $location) {
    $scope.formPost;

    $scope.savePost = function (post) {
        $http.post("/api/post", post).success(function (data) {
            $location.path("/PostDetail/" + data.Id);
        }).error(function (data) {
            console.log(JSON.stringify(data));
        });
    }

    $scope.cancel = function () { $location.path("/"); };

})